package com.adt.studioms.om;

import java.util.Date;

public class TradeTx extends Transaction<TradeTxDetail> {
    String customer;
    Long inputDate;
    Long deliveryDate;

    public TradeTx() {
        super();
        
        inputDate = System.currentTimeMillis();
        deliveryDate = System.currentTimeMillis();
    }
    
    public String getType() {
        return TRADING;
    }
    
    public TradeTxDetail createDetail() {
        TradeTxDetail detail = new TradeTxDetail();
        addDetail(detail);
        return detail;
    }

    public String getCustomer() {
        return customer;
    }

    public void setCustomer(String customer) {
        this.customer = customer;
    }

    public Long getInputDate() {
        return inputDate;
    }
    
    public Date getFormattedInputDate() {
        return inputDate!=null ? new Date(inputDate) : null;
    }

    public void setInputDate(Long inputDate) {
        this.inputDate = inputDate;
    }

    public Long getDeliveryDate() {
        return deliveryDate;
    }

    public Date getFormattedDeliveryDate() {
        return deliveryDate!=null ? new Date(deliveryDate) : null;
    }
    
    public void setDeliveryDate(Long deliveryDate) {
        this.deliveryDate = deliveryDate;
    }

}
